<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="theme-color" content="#000000" />
  <meta name="description" content="微信点餐" />
  <title>微信点餐</title>
  <link rel="stylesheet" href="/css/icon_font/iconfont.css">
  <script>
  //   let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
  // //得到html的Dom元素
  // let htmlDom = document.getElementsByTagName('html')[0];
  // //设置根元素字体大小
  // htmlDom.style.fontSize= htmlWidth/20 + 'px';

    function Rem() {
      let fontSize = 0
      let clientWidth = document.documentElement.clientWidth
      console.log(clientWidth)
      if (clientWidth <= 320) {
        fontSize = 320 / 7.5
      } else if (clientWidth > 750) {
        fontSize = 750 / 7.5
      } else {
        fontSize = clientWidth / 7.5
      }
      document.documentElement.style.fontSize = fontSize + "px"
    }
    window.onresize = () => {
      Rem()
    }
    Rem()
  </script>
</head>

<body>
  <div id="root"></div>
</body>

</html>